
public class Map {

    public int[][] map;
    public int x=0 ,y=0;
    
    
    public Map(int x, int y){
        this.x=x;
        this.y=y;
        map = new int[this.x][this.y];
    }
    
    public boolean setLocation(int x,int y, int newid){
        int temp = map[x][y];
        if(temp==newid){
            return false;
        }else{
            try{
                map[x][y] = newid;
                return true;
            }catch(java.lang.IndexOutOfBoundsException e){ 
                System.out.println(e);
                return false;
            }
        }
    }
    
    
    
}
